package com.yckj.lawyermanager.dongao.service;

import com.yckj.lawyermanager.dongao.entity.Lawyer;
import com.yckj.lawyermanager.dongao.mapper.LawyerMapper;

import java.util.List;

/**
 * @author wanghonwgei
 * @version 1.0
 * @date 2023/1/4 21:48
 */

@Service
public class LawyerServiceImpl implements LawyerService {
    @Autowired
    LawyerMapper lawyerMapper;


    /**
     * 修改律师
     *
     * @param lawyer 律师对象
     * @return 成功返回1，否则为0
     */
    @Override
    public int modifyLawyer(Lawyer lawyer) {
        return lawyerMapper.updateLawyer(lawyer);
    }

    @Override
    public Lawyer findLawyerById(int lawyerid) {
        return lawyerMapper.selectLawyerById(lawyerid);
    }

    @Override
    public int removeLawyer(int lawyerid) {
        return lawyerMapper.deleteLawyer(lawyerid);
    }

    @Override
    public List<Lawyer> findLawyer() {
        return lawyerMapper.selectLawyer();
    }

    /**
     * 添加律师对象
     *
     * @param lawyer 律师对象
     * @return 成功返回1，否则返回0
     */
    @Override
    public int addLawyer(Lawyer lawyer) {
        return lawyerMapper.insertLawyer(lawyer);
    }
}
